package com.itany.boot.springboot02quickstart.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/5/26 15:11
 * Version:1.0-SNAPSHOT
 * Description:
 */
@Component
@ConfigurationProperties(prefix = "user")
public class User {

//    @Value("${user.id}")
//    private Integer id;
//    @Value("${user.username}")
//    private String username;
//    @Value("${user.password}")
//    private String password;
//    @Value("${user.phone}")
//    private String phone;
//    @Value("${user.address}")
//    private String address;

    private Integer id;
    private String username;
    private String password;
    private String phone;
    private String address;

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
